
// 封装的数据存本地的方法
export const setItme = (key,value)=>{
  if(typeof value==='object'){
   return localStorage.setItem(key,JSON.stringify(value))
  }
  return localStorage.setItem(key,value)
}
// 读方法
export const getItem = (key)=>{
 try {
  return JSON.parse(localStorage.getItem(key))
 } catch (error) {
  return localStorage.getItem(key)
 }
}